function userData() {
    $.ajax({
        url: "findUserByUserID",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            var code = '';
            if (data.code = 200) {
                code += "<div class=\"myaccount-dashboard light-shadow-bg\">\n" +
                    "                                <div class=\"light-box-content\">\n" +
                    "                                    <div class=\"media-box\">\n" +
                    "                                        <div class=\"item-img\">\n" +
                    "                                            <img src=\"user/media/figure/avatar.jpg\" alt=\"avatar\">\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"item-content\">\n" +
                    "                                            <h3 class=\"item-title\">" + data.user_List[0].userNickname + "</h3>\n" +
                    "                                            <div class=\"item-email\"><span>Email: </span>" + data.user_List[0].userEmail + "</div>\n" +
                    "                                        </div>\n" +
                    "                                    </div>\n" +
                    "                                    <div class=\"static-report\">\n" +
                    "                                        <h3 class=\"report-title\">个人简介</h3>\n" +
                    "                                        <div class=\"report-list\">\n" +
                    "                                            <div class=\"report-item\">\n" +
                    "                                                <label>用户账号：</label>\n" +
                    "                                                <div class=\"item-value\">" + data.user_List[0].userLoginName + "</div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"report-list\">\n" +
                    "                                            <div class=\"report-item\">\n" +
                    "                                                <label>用户名称：</label>\n" +
                    "                                                <div class=\"item-value\">" + data.user_List[0].userName + "</div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"report-list\">\n" +
                    "                                            <div class=\"report-item\">\n" +
                    "                                                <label>用户性别：</label>\n" +
                    "                                                <div class=\"item-value\">" + data.user_List[0].userSex + "</div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"report-list\">\n" +
                    "                                            <div class=\"report-item\">\n" +
                    "                                                <label>用户年龄：</label>\n" +
                    "                                                <div class=\"item-value\">" + data.user_List[0].userAge + "</div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"report-list\">\n" +
                    "                                            <div class=\"report-item\">\n" +
                    "                                                <label>出生日期：</label>\n" +
                    "                                                <div class=\"item-value\">" + data.user_List[0].userDateOfBirth + "</div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"report-list\">\n" +
                    "                                            <div class=\"report-item\">\n" +
                    "                                                <label>联系方式：</label>\n" +
                    "                                                <div class=\"item-value\">" + data.user_List[0].userPhone + "</div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"report-list\">\n" +
                    "                                            <div class=\"report-item\">\n" +
                    "                                                <label>家庭住址：</label>\n" +
                    "                                                <div class=\"item-value\">" + data.user_List[0].userAddress + "</div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                    </div>\n" +
                    "                                </div>\n" +
                    "                            </div>";
            }
            $("#dashboard").html("");
            $("#dashboard").append(code);
        }

    });
}

//订单数据
function orderData(orderState) {
    var data = {
        "orderState": orderState
    }
    $.ajax({
        url: "findOrderByOrderData",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            var code = '';
            if (data.code == 500) {
                $("#data_4").html("");
                $("#data_3").html("");
                $("#data_2").html("");
                $("#data_1").html("");
            } else {
                if (data.order_list[0].orderState == 1) {
                    for (var i = 0; i < data.order_list.length; i++) {
                        code += "                                <div class=\"card-header\">\n" +
                            "                                    <a class=\"heading-title collapsed\" data-toggle=\"collapse\" href=\"#collapseOne" + data.order_list[i].orderID + "\"\n" +
                            "                                       role=\"button\" aria-expanded=\"false\" onclick=\"checkData(" + data.order_list[i].orderID + ")\">\n" +
                            "                                        " + data.order_list[i].orderName + "\n" +
                            "                                    </a>\n" +
                            "                                                        <a style='margin-left: 50%;color:red;' onclick='orderUpdate_1(" + data.order_list[i].orderID + ")'>取消订单</a>\n" +
                            "                                </div>\n" +
                            "\n" +
                            "                                <div id=\"collapseOne" + data.order_list[i].orderID + "\" class=\"collapse\" data-parent=\"#data_1\">\n" +
                            "\n" +
                            "                                </div>\n" +
                            "                            </div>";

                    }
                    $("#data_1").html("");
                    $("#data_2").html("");
                    $("#data_4").html("");
                    $("#data_3").html("");
                    $("#data_1").append(code);
                } else if (data.order_list[0].orderState == 2) {
                    for (var i = 0; i < data.order_list.length; i++) {
                        code += "                                <div class=\"card-header\">\n" +
                            "                                    <a class=\"heading-title collapsed\" data-toggle=\"collapse\" href=\"#collapseOne" + data.order_list[i].orderID + "\"\n" +
                            "                                       role=\"button\" aria-expanded=\"false\" onclick=\"checkData(" + data.order_list[i].orderID + ")\">\n" +
                            "                                        " + data.order_list[i].orderName + "\n" +
                            "                                    </a>\n" +
                            "                                                        <a style='margin-left: 50%;color:red;' onclick='orderUpdate_2(" + data.order_list[i].orderID + ")'>取消订单</a>\n" +
                            "                                </div>\n" +
                            "\n" +
                            "                                <div id=\"collapseOne" + data.order_list[i].orderID + "\" class=\"collapse\" data-parent=\"#data_2\">\n" +
                            "\n" +
                            "                                </div>\n" +
                            "                            </div>";
                    }
                    $("#data_1").html("");
                    $("#data_2").html("");
                    $("#data_4").html("");
                    $("#data_3").html("");
                    $("#data_2").append(code);
                } else if (data.order_list[0].orderState == 3) {
                    for (var i = 0; i < data.order_list.length; i++) {
                        code += "                                <div class=\"card-header\">\n" +
                            "                                    <a class=\"heading-title collapsed\" data-toggle=\"collapse\" href=\"#collapseOne" + data.order_list[i].orderID + "\"\n" +
                            "                                       role=\"button\" aria-expanded=\"false\" onclick=\"checkData_3(" + data.order_list[i].orderID + ")\">\n" +
                            "                                        " + data.order_list[i].orderName + "\n" +
                            "                                    </a>\n" +
                            "                                                        <a style='margin-left: 50%;color:red;' onclick='orderUpdate_3(" + data.order_list[i].orderID + ")'>确认订单</a>\n" +
                            "                                </div>\n" +
                            "\n" +
                            "                                <div id=\"collapseOne" + data.order_list[i].orderID + "\" class=\"collapse\" data-parent=\"#data_3\">\n" +
                            "\n"
                        "                              </div>\n" +
                        "                            </div>";
                    }
                    $("#data_1").html("");
                    $("#data_2").html("");
                    $("#data_4").html("");
                    $("#data_3").html("");
                    $("#data_3").append(code);
                } else if (data.order_list[0].orderState == 4) {
                    for (var i = 0; i < data.order_list.length; i++) {
                        code += "                                <div class=\"card-header\">\n" +
                            "                                    <a class=\"heading-title collapsed\" data-toggle=\"collapse\" href=\"#collapseOne" + data.order_list[i].orderID + "\"\n" +
                            "                                       role=\"button\" aria-expanded=\"false\" onclick=\"checkData_4(" + data.order_list[i].orderID + ")\">\n" +
                            "                                        " + data.order_list[i].orderName + "\n" +
                            "                                    </a>\n" +
                            "                                                        <a href='web-contact.html?id= " + data.order_list[i].orderID + "'style='margin-left: 50%;color:red;'>立即评价</a>\n" +
                            "                                </div>\n" +
                            "\n" +
                            "                                <div id=\"collapseOne" + data.order_list[i].orderID + "\" class=\"collapse\" data-parent=\"#data_4\">\n" +
                            "\n"
                        "                              </div>\n" +
                        "                            </div>";
                    }
                    $("#data_1").html("");
                    $("#data_2").html("");
                    $("#data_4").html("");
                    $("#data_3").html("");
                    $("#data_4").append(code);
                } else {
                    $("#data_4").html("");
                    $("#data_4").append(code);
                    $("#data_3").html("");
                    $("#data_3").append(code);
                    $("#data_2").html("");
                    $("#data_2").append(code);
                    $("#data_1").html("");
                    $("#data_1").append(code);
                }
            }

        }

    });
}

//已下单
function orderUpdate_1(orderID) {
    var data = {
        "orderState": 5,
        "orderID": orderID
    }
    $.ajax({
        url: "updateOrderByOrderState",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 200) {
                Swal.fire("温馨提示", "取消订单成功", "success");
                orderData(1);
            } else {
                Swal.fire("温馨提示", "取消订单失败", "error");
            }
        }
    });
}

//已结单
function orderUpdate_2(orderID) {
    var data = {
        "orderState": 5,
        "orderID": orderID
    }
    $.ajax({
        url: "updateOrderByOrderState",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 200) {
                Swal.fire("温馨提示", "取消订单成功", "success");
                orderData(2);
            } else {
                Swal.fire("温馨提示", "取消订单失败", "error");
            }
        }
    });
}

//确认订单
function orderUpdate_3(orderID) {
    var data = {
        "orderState": 4,
        "orderID": orderID
    }
    $.ajax({
        url: "updateOrderByOrderState",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 200) {
                Swal.fire("温馨提示", "确认订单成功", "success");
                orderData(3);
            } else {
                Swal.fire("温馨提示", "确认订单失败", "error");
            }
        }
    });
}

var numPrice = 0;

//确认订单
function checkData_3(orderID) {
    var DataSources = {
        "orderID": orderID
    };
    $.ajax({
        url: "findOrderProductByOrderProductData",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        data: JSON.stringify(DataSources),
        success: function (data) {
            if (data.code == 500) {
                Swal.fire("温馨提示", "附近没有订单", "warning");
            } else {
                var code = '';
                for (var i = 0; i < data.orderProduct_list.length; i++) {
                    numPrice = data.orderProduct_list[i].recycleProductEntity.recProductPrice * data.orderProduct_list[i].orderProductNum;
                    code += "                             <div class=\"list-view-layout1\">\n" +
                        "                                                            <div class=\"product-box-layout3\">\n" +
                        "                                                                <div class=\"item-img\">\n" +
                        "                                                                    <a href=web-single-product.html?id=" + data.orderProduct_list[i].recProductID + "><img\n" +
                        "                                                                          style='width: 275px;height: 195px;' src='upload/" + data.orderProduct_list[i].recycleProductEntity.recProductImage + "' alt=\"Product\"></a>\n" +
                        "                                                                </div>\n" +
                        "                                                                <div class=\"product-info\">\n" +
                        "                                                                    <div class=\"item-content\">\n" +
                        "                                                                        <h3 class=\"item-title\"><a href=web-single-product.html?id=" + data.orderProduct_list[i].recProductID + ">" + data.orderProduct_list[i].recycleProductEntity.recProductName + "\n" +
                        "                                                                            </a></h3>\n" +
                        "                                                                        <ul class=\"entry-meta\">\n" +
                        "                                                                            <li><i class=\"far fa-clock\"></i>" + data.orderProduct_list[i].orderProductDate + "</li>\n" +
                        "                                                                            </li>\n" +
                        "                                                                        </ul>\n" +
                        "                                                                        <ul class=\"item-condition\">\n" +
                        " <li><span>废品量:</span> </li>\n" +
                        " <li><span> " + data.orderProduct_list[i].orderProductNum + "</span> </li>\n" +
                        "                                                                        </ul>\n" +
                        "                                                                        <div class=\"btn-group\">\n" +
                        "                                                                        </div>\n" +
                        "                                                                    </div>\n" +
                        "                                                                    <div class=\"item-right\">\n" +
                        "                                                                        <div class=\"item-price\">\n" +
                        "                                                                            <span class=\"currency-symbol\">$</span>\n" +
                        "                                                                          " + numPrice + "\n" +
                        "                                                                        </div>\n" +
                        "                                                                    </div>\n" +
                        "                                                                </div>\n" +
                        "                                                            </div>\n" +
                        "                                                        </div>\n";
                }
                $("#collapseOne" + orderID).html("");
                $("#collapseOne" + orderID).append(code);
            }
        }
    });
}

var numPrice1 = 0;

//完成订单
function checkData_4(orderID) {
    var DataSources = {
        "orderID": orderID
    };
    $.ajax({
        url: "findOrderProductByOrderProductData",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        data: JSON.stringify(DataSources),
        success: function (data) {
            if (data.code == 500) {
                Swal.fire("温馨提示", "附近没有订单", "warning");
            } else {
                var code = '';
                for (var i = 0; i < data.orderProduct_list.length; i++) {
                    numPrice = data.orderProduct_list[i].recycleProductEntity.recProductPrice * data.orderProduct_list[i].orderProductNum;
                    numPrice1 += data.orderProduct_list[i].recycleProductEntity.recProductPrice * data.orderProduct_list[i].orderProductNum;
                    code += "                             <div class=\"list-view-layout1\">\n" +
                        "                                                            <div class=\"product-box-layout3\">\n" +
                        "                                                                <div class=\"item-img\">\n" +
                        "                                                                    <a href=web-single-product.html?id=" + data.orderProduct_list[i].recProductID + "><img\n" +
                        "                                                                          style='width: 275px;height: 195px;' src='upload/" + data.orderProduct_list[i].recycleProductEntity.recProductImage + "' alt=\"Product\"></a>\n" +
                        "                                                                </div>\n" +
                        "                                                                <div class=\"product-info\">\n" +
                        "                                                                    <div class=\"item-content\">\n" +
                        "                                                                        <h3 class=\"item-title\"><a href=web-single-product.html?id=" + data.orderProduct_list[i].recProductID + ">" + data.orderProduct_list[i].recycleProductEntity.recProductName + "\n" +
                        "                                                                            </a></h3>\n" +
                        "                                                                        <ul class=\"entry-meta\">\n" +
                        "                                                                            <li><i class=\"far fa-clock\"></i>" + data.orderProduct_list[i].orderProductDate + "</li>\n" +
                        "                                                                            </li>\n" +
                        "                                                                        </ul>\n" +
                        "                                                                        <ul class=\"item-condition\">\n" +
                        " <li><span>废品量:</span> </li>\n" +
                        " <li><span> " + data.orderProduct_list[i].orderProductNum + "</span> </li>\n" +
                        "                                                                        </ul>\n" +
                        "                                                                        <div class=\"btn-group\">\n" +
                        "                                                                        </div>\n" +
                        "                                                                    </div>\n" +
                        "                                                                    <div class=\"item-right\">\n" +
                        "                                                                        <div class=\"item-price\">\n" +
                        "                                                                            <span class=\"currency-symbol\">$</span>\n" +
                        "                                                                          " + numPrice + "\n" +
                        "                                                                        </div>\n" +
                        "                                                                    </div>\n" +
                        "                                                                </div>\n" +
                        "                                                            </div>\n" +
                        "                                                        </div>\n";
                }
                var detail = '';
                detail += "                                                        <div class=\"pagination-layout1\">\n" +
                    "                                                            <div class=\"btn-prev disabled\">\n" +
                    "\n" +
                    "                                                            </div>\n" +
                    "                                                            <div class=\"page-number\">\n" +
                    "\n" +
                    "                                                            </div>\n" +
                    "                                                            <div class=\"btn-next\">\n" +
                    "                                                                <a><i class=\"fas fa-angle-double-right\"></i>总价:<span>" + numPrice1 + "</span></a>\n" +
                    "                                                            </div>\n" +
                    "                                                        </div>";
                $("#collapseOne" + orderID).html("");
                $("#collapseOne" + orderID).append(code);
                $("#collapseOne" + orderID).append(detail);
                numPrice1 = 0;
            }
        }
    });
}

//已接单
function checkData(orderID) {
    var DataSources = {
        "orderID": orderID
    };
    $.ajax({
        url: "findOrderProductByOrderProductData",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        data: JSON.stringify(DataSources),
        success: function (data) {
            if (data.code == 500) {
                Swal.fire("温馨提示", "附近没有订单", "warning");
            } else {
                var code = '';
                for (var i = 0; i < data.orderProduct_list.length; i++) {
                    code += "                             <div class=\"list-view-layout1\">\n" +
                        "                                                            <div class=\"product-box-layout3\">\n" +
                        "                                                                <div class=\"item-img\">\n" +
                        "                                                                    <a href=web-single-product.html?id=" + data.orderProduct_list[i].recProductID + "><img\n" +
                        "                                                                          style='width: 275px;height: 195px;' src='upload/" + data.orderProduct_list[i].recycleProductEntity.recProductImage + "' alt=\"Product\"></a>\n" +
                        "                                                                </div>\n" +
                        "                                                                <div class=\"product-info\">\n" +
                        "                                                                    <div class=\"item-content\">\n" +
                        "                                                                        <h3 class=\"item-title\"><a href=web-single-product.html?id=" + data.orderProduct_list[i].recProductID + ">" + data.orderProduct_list[i].recycleProductEntity.recProductName + "\n" +
                        "                                                                            </a></h3>\n" +
                        "                                                                        <ul class=\"entry-meta\">\n" +
                        "                                                                            <li><i class=\"far fa-clock\"></i>" + data.orderProduct_list[i].orderProductDate + "</li>\n" +
                        "                                                                            </li>\n" +
                        "                                                                        </ul>\n" +
                        "                                                                        <ul class=\"item-condition\">\n" +
                        "                                                                        </ul>\n" +
                        "                                                                        <div class=\"btn-group\">\n" +
                        "                                                                        </div>\n" +
                        "                                                                    </div>\n" +
                        "                                                                    <div class=\"item-right\">\n" +
                        "                                                                        <div class=\"item-price\">\n" +
                        "                                                                            <span class=\"currency-symbol\">$</span>\n" +
                        "                                                                          " + data.orderProduct_list[i].recycleProductEntity.recProductPrice + "\n" +
                        "                                                                        </div>\n" +
                        "                                                                    </div>\n" +
                        "                                                                </div>\n" +
                        "                                                            </div>\n" +
                        "                                                        </div>\n";
                }
                $("#collapseOne" + orderID).html("");
                $("#collapseOne" + orderID).append(code);
            }
        }
    });
}

function updateCollectionCompByCollectionComp(collectionCompID) {
    var data = {
        "collectionCompID": collectionCompID
    }
    $.ajax({
        url: "updateCollectionCompByCollectionComp",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 200) {
                Swal.fire("温馨提示", "取消收藏成功", "success");
                collectionCompanyData();
            } else {
                Swal.fire("温馨提示", "取消收藏失败", "error");
            }
        }
    });
}

//收藏查询
function collectionCompanyData() {
    $.ajax({
        url: "findCollectionCompByCollectionComp",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            var code = '';
            for (var i = 0; i < data.collection_list.length; i++) {
                code += "<div class=\"list-view-layout1\">\n" +
                    "                                        <div class=\"product-box-layout3\">\n" +
                    "                                            <div class=\"item-img\">\n" +
                    "                                                <a href=web-single-company.html?id=" + data.collection_list[i].compID + " class=\"item-trending\"><img\n" +
                    "                                                    style='width: 275px;height: 195px;' src='upload/" + data.collection_list[i].companyEntity.compPhoto + "'   alt=\"Product\"></a>\n" +
                    "                                                <div class=\"bg-color-price\">\n" +
                    "                                                </div>\n" +
                    "                                            </div>\n" +
                    "                                            <div class=\"product-info\">\n" +
                    "                                                <div class=\"item-content\">\n" +
                    "                                                    <h3 class=\"item-title\"><a href=web-single-company.html?id=" + data.collection_list[i].compID + ">" + data.collection_list[i].companyEntity.compName + "</a><span>New</span></h3>\n" +
                    "                                                    <ul class=\"entry-meta\">\n" +
                    "                                                        <li><i class=\"far fa-clock\"></i>" + data.collection_list[i].companyEntity.compDate + "</li>\n" +
                    "                                                        <li><i class=\"fas fa-map-marker-alt\"></i>" + data.collection_list[i].companyEntity.compAddress + "</li>\n" +
                    "                                                    </ul>\n" +
                    "                                                    <ul class=\"item-condition\">\n" +

                    "                                                    </ul>\n" +
                    "                                                    <div class=\"btn-group\">\n" +
                    "                                                        <a  onclick='updateCollectionCompByCollectionComp(" + data.collection_list[i].collectionCompID + ")'>移除收藏</a>\n" +
                    "                                                    </div>\n" +
                    "                                                </div>\n" +
                    "                                                <div class=\"item-right\">\n" +
                    "                                                    <div class=\"item-btn\">\n" +
                    "                                                        <a href=web-single-company.html?id=" + data.collection_list[i].compID + ">Details</a>\n" +
                    "                                                    </div>\n" +
                    "                                                </div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                    </div>";
            }
            $("#collectionComp").html("");
            $("#collectionComp").append(code);
        }
    });
}

function updateCollectionRecycleByCollectionRecycle(collectionRecycleID) {
    var data = {
        "collectionRecycleID": collectionRecycleID
    }
    $.ajax({
        url: "updateCollectionRecycleByCollectionRecycle",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 200) {
                Swal.fire("温馨提示", "取消收藏成功", "success");
                collectionRecycleData();
            } else {
                Swal.fire("温馨提示", "取消收藏失败", "error");
            }
        }
    });
}

//收藏查询
function collectionRecycleData() {
    $.ajax({
        url: "findCollectionRecycleByCollectionRecycle",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            var code = '';
            for (var i = 0; i < data.collection_list.length; i++) {
                code += "<div class=\"list-view-layout1\">\n" +
                    "                                        <div class=\"product-box-layout3\">\n" +
                    "                                            <div class=\"item-img\">\n" +
                    "                                                <a href=web-single-product.html?id=" + data.collection_list[i].recProductID + " class=\"item-trending\"><img\n" +
                    "                                                    style='width: 275px;height: 195px;' src='upload/" + data.collection_list[i].recycleProductEntity.recProductImage + "'   alt=\"Product\"></a>\n" +
                    "                                                <div class=\"bg-color-price\">\n" +
                    "                                                </div>\n" +
                    "                                            </div>\n" +
                    "                                            <div class=\"product-info\">\n" +
                    "                                                <div class=\"item-content\">\n" +
                    "                                                    <h3 class=\"item-title\"><a href=web-single-product.html?id=" + data.collection_list[i].recProductID + " >" + data.collection_list[i].recycleProductEntity.recProductName + "</a><span>New</span></h3>\n" +
                    "                                                    <ul class=\"entry-meta\">\n" +
                    "                                                        <li><i class=\"far fa-clock\"></i>" + data.collection_list[i].recycleProductEntity.recProductDate + "</li>\n" +
                    "                                                    </ul>\n" +
                    "                                                    <ul class=\"item-condition\">\n" +

                    "                                                    </ul>\n" +
                    "                                                    <div class=\"btn-group\">\n" +
                    "                                                        <a  onclick='updateCollectionRecycleByCollectionRecycle(" + data.collection_list[i].collectionRecycleID + ")'>移除收藏</a>\n" +
                    "                                                    </div>\n" +
                    "                                                </div>\n" +
                    "                                                <div class=\"item-right\">\n" +
                    "                                                  <div class=\"item-price\">\n" +
                    "                                                        <span class=\"currency-symbol\">$</span>\n" +
                    "                                                    " + data.collection_list[i].recycleProductEntity.recProductPrice + "<span>/</span>\n" +
                    "                               " + data.collection_list[i].recycleProductEntity.recProductUnit + " \n" +
                    "                                                    </div>\n" +
                    "                                                    <div class=\"item-btn\">\n" +
                    "                                                        <a href=web-single-product.html?id=" + data.collection_list[i].recProductID + ">Details</a>\n" +
                    "                                                    </div>\n" +
                    "                                                </div>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                    </div>";
            }
            $("#collectionRecycleData").html("");
            $("#collectionRecycleData").append(code);
        }
    });
}

$(function () {
    var DATA = '';
    $.ajax({
        url: "JudgeLogin_4",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 500) {
                DATA += " <li class=\"header-btn\">\n" +
                    "                                    <a href=\"web-login.html\" class=\"item-btn\"><i class=\"fas fa-plus\"></i>登录</a>\n" +
                    "                                </li>"
                Swal.fire("温馨提示", "请先登录", "warning");
                window.location.href = "web-404.html";
            } else {
                DATA += " <li class=\"header-login-icon\">\n" +
                    "                                    <a href=\"web-account.html\" class=\"color-light\" data-toggle=\"tooltip\"\n" +
                    "                                       data-placement=\"top\" title=\"Login/Register\">\n" +
                    "                                        <i class=\"far fa-user\">我的</i>\n" +
                    "                                    </a>\n" +
                    "                                </li>\n" +
                    "                                <li class=\"header-btn\">\n" +
                    "                                    <a  onclick='tuichu()' class=\"item-btn\"><i class=\"fas fa-plus\"></i>退出</a>\n" +
                    "                                </li>";
                userData();
            }
            $("#userData").html("");
            $("#userData").append(DATA);
        }
    });
});